home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 August
/
1986-08.d64
/
pirate cove
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
7KB
|
263 lines
10 x=rnd(-ti):s=54272:v=53248
20 dim t(25),r$(25),r1$(25),i$(8)
30 dim q$(2,8),q1$(2,25)
40 dim a$(2,8),a1$(2,25)
50 dim d(125),lo(25),lc(25),l(25)
60 poke53281,0:poke53280,0:print"[147]"
70 fori=0to24:pokes+i,0:next
80 print""tab(14)"[155]pirate cove":gosub1470:gosub1470
90 print"a mini-adventure for kids"
100 printtab(13)"[154][please wait]"
110 fori=12288to12607:reada:pokei,a:next
120 poke2040,193
130 fori=2041to2043:pokei,197:next
140 fori=v+40tov+42:pokei,2:next
150 pokev+39,10:pokev+37,7:pokev+38,5
160 pokev+29,15:pokev+23,1
170 pokev+28,1:pokev+27,14
180 pokev+16,1:pokev,0:pokev+1,75
190 x=61:y=81:pokev+21,1
200 pokev+2,x:pokev+4,x+48:pokev+6,x+96
210 fori=12608to12608+23:pokei,255:next
220 fori=12608+24to12608+63:pokei,0:next
230 fori=1to10:readr$(i):next
240 fori=1to8:readq$(1,i):reada$(1,i):next
250 fori=1to8:readq$(2,i):reada$(2,i):next
260 fori=1to100:readd(i):next
270 fori=1to25:readlo(i):next
280 fori=11to25:r$(i)="high seas":next
290 fori=1to10:lc(i)=1:next
300 fori=11to25:lc(i)=2:next
310 f1=0:f2=0:q=1
320 fori=1to8:i$(i)="":next
330 fori=1to25:t(i)=0:next
340 fori=1to25
350 rn=int(rnd(1)*25)+1
360 ift(rn)=1then350
370 t(rn)=1:r1$(rn)=r$(i):l(rn)=lc(i)
380 next
390 z=1:fori=1to25
400 ifr1$(i)="treasure island"then480
410 ifr1$(i)="sea monster's lair"then480
420 ifr1$(i)="high seas"then480
430 q1$(1,i)=q$(1,z)
440 q1$(2,i)=q$(2,z)
450 a1$(1,i)=a$(1,z)
460 a1$(2,i)=a$(2,z)
470 z=z+1
480 next
490 fori=1to25:ifr1$(i)="pirate cove"thenr=i:rr=r
500 next
510 tm=r:ifr1$(r)="treasure island"then1040
520 print"[147][155]current location: ";
530 gosub1470
540 printr1$(r)"[155]"
550 print""
560 ifr1$(r)="high seas"then960
570 ifr1$(r)="sea monster's lair"then1270
580 poke2040,193:pokev+39,10:pokev+37,7:pokev+38,5
590 y=81:k=1:d=5
600 pokev+3,y:pokev+5,y:pokev+7,y:pokev+21,15
610 l=len(q1$(1,r)):l2=len(q1$(2,r))
620 printtab(14-l/2)"[155]"q1$(1,r)
630 printtab(14-l2/2)q1$(2,r)
640 printtab(10)"read map"
650 printtab(10)"sail on"
660 printtab(7)"list inventory"
670 gosub1790
680 onkgoto860,860,1520,690,1910
690 print"[147][155]sail:[158]";
700 y=81:d=4:k=1
710 pokev+3,y:pokev+21,3
720 print"[155]"tab(5)"north"
730 printtab(5)"south"
740 printtab(5)"east"
750 printtab(5)"west"
760 gosub1790
770 ifk=1thenr=r-5
780 ifk=2thenr=r+5
790 ifk=3thenr=r+1
800 ifk=4thenr=r-1
810 ifd(((tm-1)*4)+k)=1thenpokev+21,1:goto510
820 poke2040,196:pokev+39,6:pokev+37,1:pokev+38,7:pokev+21,1
830 print"storm ahead-go another way":print"":gosub1890:gosub1470
840 gosub1860:r=tm:goto690
850 -----rem search-----
860 print"[156]you find "a1$(k,r)
870 g$=a1$(k,r)
880 ifg$="a key"thenf1=1
890 ifg$="a cutlass"thenf2=1
900 ifleft$(g$,7)="nothing"then940
910 fori=1to8:ifg$=i$(i)then940
920 next
930 i$(q)=g$:q=q+1
940 printtab(7)"":gosub1860:goto510
950 -----rem high seas-----
960 poke2040,192:pokev+39,6:pokev+37,1:pokev+38,2
970 k=1:d=2:y=81
980 pokev+3,y:pokev+5,y:pokev+21,7
990 printtab(7)"[155]read map"
1000 printtab(7)"sail on"
1010 gosub1790
1020 onkgoto1520,690
1030 -----rem treasure island-----
1040 poke2040,193:pokev+39,10:pokev+37,7:pokev+38,5
1050 print"[147][155]you have landed at treasure island":gosub1890:gosub1470
1060 print"and found the treasure chest"
1070 print"[153]press any key to see if it will open."
1080 getk$:ifk$=""then1080
1090 if f1=1then1150
1100 print"[147][155]you don't have the key"
1110 print"you must continue on your journey,"
1120 print"find the key and return to
1130 [153]"treasure island."
1140 [141]1860:[137]690
1150 [151]2040,194:[151]v[170]39,6:[151]v[170]37,1:[151]v[170]38,2:[141]1890
1160 [153]"loadlistyour key opens the chest."
1170 [153]"you win"
1180 [153]"printother treasures:list"
1190 [129]i[178]1[164]8:[153]i$(i):[130]
1200 [153]"contplay again [y/n]
1210 getk$:ifk$=""then1210
1220 ifk$="y"thenpokev+21,0:goto1250
1230 ifk$="n"thensys2048:end
1240 goto1210
1250 printtab(9)"[154][please wait a moment]":goto310
1260 -----rem monster-----
1270 pokev+39,6:pokev+37,2:pokev+38,1:poke2040,195
1280 y=81:d=2:k=1:pokev+3,y:pokev+5,y:pokev+21,7:gosub1890
1290 printtab(6)"sail away"
1300 printtab(8)"fight"
1310 gosub1790
1320 ifk=2then1390
1330 rn=rnd(1):ifrn>.8thentm=r:goto690
1340 print"not fast enough"
1350 print"the monster damaged your ship"
1360 print"you must go back to pirate cove and
1370 [153]"start over again."
1380 r[178]rr:[141]1860:[137]510
1390 [139]f2[178]0[167]1430
1400 [153]"you defeated the sea monster"
1410 [153]"you may continue on your journey."
1420 tm[178]r:[141]1860:[151]v[170]21,1:[137]690
1430 [153]"you cannot fight the monster without"
1440 [153]"a cutlass"
1450 [137]1360
1460 [171][171][171][171][171][143] sound sub-----
1470 [151]s[170]24,15:[151]s[170]5,9:[151]s[170]4,17
1480 [151]s[170]1,6:[151]s,108:[129]t[178]1[164]1000:[130]
1490 [151]s[170]4,16:[129]t[178]1[164]25:[130]
1500 [142]
1510 [171][171][171][171][171][143] draw map-----
1520 [151]v[170]21,0
1530 [153]"load"[163]7)"listnavigation map"
1540 x$[178]"(NULL)usr(NULL)"
1550 y$[178]"sgn +"
1560 z$[178]"(NULL)andsqr"
1570 [129]i[178]1[164]5:[153][163]7);
1580 [129]j[178]1[164]5:[153]x$;:[130]:[153]
1590 [153][163]7);
1600 [129]j[178]1[164]5:[153]y$;:[130]:[153]
1610 [153][163]7);
1620 [129]j[178]1[164]5:[153]z$;:[130]:[153]
1630 [130]
1640 [129]i[178]1[164]25
1650 [139]l(i)[178]1[167][151]lo(i),81:[151]lo(i)[170]s,5
1660 [139]l(i)[178]2[167][151]lo(i),45:[151]lo(i)[170]s,6
1670 [130]
1680 [151]lo(r),81:[151]lo(r)[170]s,7
1690 [153]""[163]27)"(NULL)list = land"
1700 [153][163]27)"-list = water"
1710 [153][163]27)"sys(NULL)list = current"
1720 [153][163]31)"location"
1730 [153][163]33)"sysn"
1740 [153][163]33)"(NULL)"
1750 [153][163]31)"w-(NULL)-e"
1760 [153][163]33)"(NULL)"
1770 [153][163]33)"s"
1780 [153]"":[141]1860:[137]510
1790 [161]k$:[139]k$[178]""[167]1790
1800 [139]k$[178][199](13)[167][142]
1810 [139]k$[179][177]""[167]1790
1820 k[178]k[170]1:y[178]y[170]8
1830 [139]k[177]d[167]k[178]1:y[178]81
1840 [151]v[170]3,y:[151]v[170]5,y:[151]v[170]7,y
1850 [137]1790
1860 [153][163]6)"cont[press any key to continue]"
1870 [161]k$:[139]k$[178]""[167]1870
1880 [142]
1890 [129]i[178]1[164]11:[151]53280,i
1900 [129]t[178]1[164]25:[130]:[130]:[151]53280,0:[142]
1910 [153]"inventory:"
1920 [129]i[178]1[164]8:[153]i$(i):[130]
1930 [153]"":[141]1860:[151]v[170]21,1:[137]520
1940 [131] 0,0,0,1,192,0,1,192
1950 [131] 0,4,192,0,4,192,0,20
1960 [131] 192,0,20,192,0,20,193,192
1970 [131] 20,197,192,4,197,192,4,197
1980 [131] 192,1,197,192,1,193,192,240
1990 [131] 192,207,63,255,252,15,255,252
2000 [131] 3,255,252,170,187,190,42,174
2010 [131] 234,10,170,168,0,170,128,255
2020 [131]0,0,0,0,0,60,0,0
2030 [131]192,3,195,0,0,51,240,0
2040 [131]15,12,3,248,192,12,8,48
2050 [131]0,50,48,0,194,0,0,192
2060 [131]128,0,192,128,0,0,128,0
2070 [131]0,128,0,2,0,0,86,64
2080 [131]5,85,84,21,85,80,1,85
2090 [131]64,0,21,0,0,0,0,0
2100 [131]5,0,0,1,64,0,0,80
2110 [131]0,0,20,0,0,5,0,0
2120 [131]1,64,0,0,80,21,85,80
2130 [131]16,0,16,18,170,16,18,34
2140 [131]16,208,32,16,16,32,28,16
2150 [131]32,16,208,32,19,21,85,80
2160 [131]0,0,204,48,12,48,0,195
2170 [131]12,12,12,48,0,0,192,0
2180 [131]0,16,0,0,32,0,0,8
2190 [131]0,0,8,0,0,8,0,72
2200 [131]32,33,34,32,136,0,170,0
2210 [131]0,158,0,10,182,160,160,158
2220 [131]10,128,182,2,64,170,1,2
2230 [131]8,128,8,8,32,8,32,32
2240 [131]16,32,4,0,32,0,0,8
2250 [131]0,0,4,0,0,0,0,0
2260 [131] 1,84,0,4,1,64,4,0
2270 [131] 20,16,0,1,16,80,1,17
2280 [131] 0,1,64,0,65,64,0,68
2290 [131] 16,1,80,5,84,128,128,48
2300 [131] 8,8,50,0,0,192,200,32
2310 [131] 200,192,0,192,194,35,195,32
2320 [131] 3,35,0,3,3,8,3,12
2330 [131] 0,0,12,0,0,12,0,72
2340 [131] treasure island, sea monster's lair, bluebeard's bay
2350 [131] mermaid's lagoon, capt. hook's swamp, spice island
2360 [131] jewel island, skeleton inlet, barbary coast,pirate cove
2370 [131] sift through sand, a few pieces of eight
2380 [131] search island, nothing of interest.
2390 [131] search old galleon, some silver jewelry
2400 [131] search island, exotic spices
2410 [131] search harbor, a cutlass
2420 [131] search swamp, nothing but snakes
2430 [131] sea